#include "widget.h"
#include "ui_widget.h"
#include<QFileDialog>
#include<QFileInfo>
#include<QDebug>
#include"thread.h"
Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
//    Thread r1;
//    Thread r2;

//    r1.start();
//    r2.start();

//    r1.wait();
//    r2.wait();

//    qDebug()<<Thread::num;
    ui->pushButton->setStyleSheet("#pushButton{color:red;}");
//    ui->pushButton->setStyleSheet("#pushButton_2{color:green;}");
//    thread.start();
//    connect(&thread,&Thread::notify,this,&Widget::handle);
}

Widget::~Widget()
{
    delete ui;
}


void Widget::on_pushButton_clicked()
{
    QString path=QFileDialog::getOpenFileName(this);
    QFileInfo fileinfo(path);
    qDebug()<<fileinfo.path()
           <<fileinfo.fileName()
          <<fileinfo.suffix();
}

void Widget::handle()
{
    int value=ui->lcdNumber->intValue();
    value--;
    ui->lcdNumber->display(value);
}
